package main

import "fmt"

type MyInterface1 interface {
	Fly(string)
	Eat(string)
}

type MyInterface2 interface {
	Fly(string)
	Eat(string)
}

type Impl1 struct {
	name string
}

func (i Impl1) Fly(name string) {
	fmt.Println(name, "会飞")
}

func (i Impl1) Eat(name string) {
	fmt.Println(name, "会吃")
}

func main() {

	a := Impl1{
		"hello",
	}

	var a2 MyInterface1 = a
	var a3 MyInterface2 = a
	a2.Fly("hello2")
	a2.Eat("hello2")

	a3.Eat("hello3")
	a3.Fly("hello3")

}
